import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    component:()=> import('../views/index/index.vue'),
    children:[
      {
        path:'home',
        component:() => import('../views/index/home.vue')
      },
      {
        path:'cate',
        component:() => import('../views/index/cate.vue')
      },
      {
        path:'cart',
        component:() => import('../views/index/cart.vue')
      },
      {
        path:'my',
        component:() => import('../views/index/my.vue')
      },
      {
        path:'',
        redirect:'home'
      }
    ]
  },
  {
    path:'/login',
    component: () => import('../views/login/login.vue')
  },
  {
    path:'/register',
    component: () => import('../views/register/register.vue')
  },
  {
    path:'/goodslist',
    component: () => import('../views/goodslist.vue')
  },
  {
    path:'/goodsdetail/:id',
    component: () => import('../views/goodsDetail.vue')
  },
  {
    path:'/addredd',
    component: () => import('../views/addredd.vue')
  },
  {
    path:'/shouhuo',
    component: () => import('../views/shouhuo.vue')
  },
  {
    path:'/addressedit',
    component: () => import('../views/addressedit.vue')
  },
  {
    path:'/serache',
    component: () => import('../views/serache.vue')
  }
]

const router = new VueRouter({
  routes
})


export default router
